-- function add( ... )
--     local arg = table.pack(...)
--     local sum = 0
--     for i = 1, arg.n do
--         if arg[i] ~= nil then
--             sum = sum + arg[i]
--         end
--     end
--     return sum 
-- end

-- print(add(1,2,3,4,5,5)) -- 20
-- print(add(1,2,3,4,nil,5)) -- 15

-- 少量参数的时候效率比pack高，大量参数的时候还是table.pack
-- function add(...)
--     local sum = 0
--     for i= 1,select("#",...) do
--         sum = sum + select(i,...)
--     end
--     return sum
-- end

-- print(add(1,2,3,4,5,5)) -- 20
-- -- print(add(1,2,3,4,nil,5)) -- error


-- function f123 return 1,2,3 end
-- function f456 return 4,5,6 end

-- f123()
print(string.find("hello","ll"))
f = string.find
a = {"hello","ll"}

print(f(table.unpack(a)))

print(table.unpack({"Sum","Mon","Tue","Wed"},2,4))